package com.neo.push.server.message;

import com.alibaba.fastjson.JSON;
import com.neo.push.core.AcceptPush;
import com.neo.push.core.PushBucket;
import com.neo.push.core.PushText;

import java.util.Date;
import java.util.List;

/**
 * Created by lock on 17-7-31.
 */
public class PushMessageFactory {


    private PushMessageFactory(){}


    public static AcceptPush instancePushWithoutId(String target, String content){
        PushText pushText = new PushText();
        pushText.setTargetName(target);
        pushText.setContent(content);
        pushText.setCreateTime(new Date());
        return pushText;
    }



    public static AcceptPush instancePushBucketWithoutId(String target, List<AcceptPush> textList){
        PushBucket pushText = new PushBucket();
        pushText.setTargetName(target);
        pushText.setContent(JSON.toJSONString(textList));
        pushText.setCreateTime(new Date());
        return pushText;
    }




}
